package com.example.designpatterns.behavioral.command;

/**
 * 客户端代码（具体使用）
 *
 * @author scott
 */
public class Client {

    public static void main(String[] args) {
        TV tv = new TV();
        Command turnOnCommand = new TurnOnCommand(tv);
        Command turnOffCommand = new TurnOffCommand(tv);

        RemoteControl remoteControl = new RemoteControl();
        remoteControl.setCommand(turnOnCommand);
        remoteControl.pressButton();

        remoteControl.setCommand(turnOffCommand);
        remoteControl.pressButton();
    }

}
